package com.example.springbootrbac.param;


import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;

@Data

public class UserParam {
    @NotNull(message = "用户不能为空")
    @NotBlank(message = "用户不能为空或者全为空格")
    @Size(message = "用户名长度为3-25个字符", min = 3, max = 25)
    private String username;

    @NotNull(message = "密码不能为空")
    @NotBlank(message = "密码不能为空或者全为空格")
    @Size(message = "密码名长度为4-25个字符", min = 4, max = 25)
    @Pattern(message = "密码最少4位，最多25位，包括至少1个小写字母，1个数字，1个特殊字符(!@#$%^&*?.)",
            regexp = "^.*(?=.{4,25})(?=.*\\d)(?=.*[a-z])(?=.*[!@#$%^&*?.]).*$"
    )
    private String password;
}
